package recursion;

public class FactorialDemo {
    public static long jieCheng(long num) {
        if (num == 1) {
            return 1;
        }
        return num * jieCheng(--num);
    }

    public static void main(String[] args) {


        long result = 0;
        result = jieCheng(5);
        System.out.println(result);


    }
}
